FROM openjdk:17.0.2 AS build
COPY . .
RUN mvn clean install -Dmaven.test.skip=true -Dmaven.test.failure.ignore=true

FROM openjdk:17.0.2

RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

WORKDIR /opt/projects/mall4j

COPY --from=build ./yami-shop-admin/target/yami-shop-admin-0.0.1-SNAPSHOT.jar ./

EXPOSE 8085

CMD java -jar -Xms512m -Xmx512m -Xss256k -XX:SurvivorRatio=8 -XX:+UseConcMarkSweepGC -Dspring.profiles.active=docker yami-shop-admin-0.0.1-SNAPSHOT.jar
